package studentdemo.server;

import studentdemo.dao.TeachDao;
import studentdemo.dao.TeachDaoImpl;
import studentdemo.modul.Teach;
import java.util.List;

public class TeachService {
    private final TeachDao teachDao = new TeachDaoImpl();

    public boolean addTeach(Teach teach) {
        return teachDao.insertTeach(teach) > 0;
    }

    public boolean deleteTeach(String tecno, String tetno) {
        return teachDao.deleteTeach(tecno, tetno) > 0;
    }

    public List<Teach> getTeachesByCourse(String tecno) {
        return teachDao.getTeachesByCourse(tecno);
    }

    public List<Teach> getTeachesByTeacher(String tetno) {
        return teachDao.getTeachesByTeacher(tetno);
    }

    public List<Teach> getAllTeaches() {
        return teachDao.getAllTeaches();
    }
} 